package org.rednebula.simple.web.action;

import org.rednebula.framework.core.model.RequestType;
import org.rednebula.framework.core.web.action.BasicAction;
import org.rednebula.simple.model.form.PersonForm;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller
@Scope("prototype")
public class SimpleAction <T extends PersonForm> extends BasicAction<T> {
	public String create(){
		this.getBusinessForm().setRequestType(RequestType.create);
		this.getBusinessForm().setCache(true);
		this.getBusinessForm().handle(this.getProcedureEngine().getEnvironment());
		return "simple";
	}
	
	public String modify(){
		getBusinessForm().setRequestType(RequestType.modify);
		this.getBusinessForm().handle(this.getProcedureEngine().getEnvironment());
		return "simple";
	}

}
